package com.cbs.android.component.application.activity.handler;

import android.app.Activity;
import android.content.Intent;

/**
 * Created by broche on 1/16/16.
 */
public abstract class CBSSimpleActivityResultHandler implements CBSActivityResultHandler {
    public abstract void onSuccess(int requestCode, Intent data);

    public abstract void onCancel(int requestCode, Intent data);

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK) {
            onSuccess(requestCode, data);
        } else {
            onCancel(requestCode, data);
        }
    }
}
